<?php
function reequipment_adminapi_updaterel($args)
{
    // Get arguments from argument array
    extract($args);

    // Get datbase setup
    $dbconn =& xarDBGetConn();
    $xartable =& xarDBGetTables();
    $table = $xartable['rel_eq'];

    $update = array();
    $bindvars = array();

    // Update item
    $query = "UPDATE $table SET ";
    if (isset($user_id)){
        $update[] = "user_id = ? ";
        $bindvars[] = $user_id;
    }
    if (isset($company_id)){
        $update[] = "company_id = ? ";
        $bindvars[] = $company_id;
    }
    if (isset($company_name)){
        $update[] = "company_name = ? ";
        $bindvars[] = $company_name;
    }

    $query .= join(",",$update);
    $query .= "WHERE company_id = ? ";
    $bindvars[] = $company_id;
    $result =& $dbconn->Execute($query, $bindvars);
    if (!$result) return;

    return true;
}
?>